<template>
    <div style="width: 100%;height: 400px;" ref="chart"></div>
</template>

<script>
export default {
    name: 'category_pie',

    data() {
        return {
            
        };
    },

    mounted() {
        this.initEchart();
    },

    methods: {
        initEchart() {
                let myChart = this.$echarts.init(this.$refs.chart)
                // 绘制图表
                myChart.setOption({
                    title: {
                        text: '今日出货分类比例',
                        left: 'center'
                    },
                    tooltip: {
                        trigger: 'item'
                    },
                    legend: {
                        orient: 'vertical',
                        left: 'left',
                        top:'25px'
                    },
                    series: [
                        {
                            name: '出货',
                            type: 'pie',
                            radius: '55%',
                            center:["50%","65%"],
                            data: [
                                { value: 1048, name: '电器' },
                                { value: 735, name: '家具' },
                                { value: 580, name: '生活用品' },
                                { value: 484, name: '食品' },
                                { value: 300, name: '文具' }
                            ],
                            emphasis: {
                                itemStyle: {
                                    shadowBlur: 10,
                                    shadowOffsetX: 0,
                                    shadowColor: 'rgba(0, 0, 0, 0'
                                }
                            }
                        }
                    ]

                });

            }
    },
};
</script>

<style lang="scss" scoped>

</style>